﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace TextAnalyzer
{
    internal class CategoryViewModel:INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        private string mCategory = null;
        private bool mCaseComparison = false;
        private string mParent = null;
        public string Category
        {
            get { return mCategory; }
            set
            {
                mCategory = value;
                RaisePropertyChanged("Category");
            }
        }
        public bool CaseComparison
        {
            get { return mCaseComparison; }
            set
            {
                mCaseComparison = value;
                RaisePropertyChanged("CaseComparison");
            }
        }
        public string Parent
        {
            get { return mParent; }
            set
            {
                mParent = value;
                RaisePropertyChanged("Parent");
            }
        }
        public CategoryViewModel()
        {
            this.Category = null;
            this.CaseComparison = false;
            this.Parent = null;
        }
        public CategoryViewModel(string strCategory, bool bCaseComparison, string strParent)
        {
            this.Category = strCategory;
            this.CaseComparison = bCaseComparison;
            this.Parent = strParent;
        }
        private void RaisePropertyChanged(string strPropertyName)
        {
            PropertyChangedEventHandler _handler = this.PropertyChanged;
            if (null != _handler) _handler(this, new PropertyChangedEventArgs(strPropertyName));
        }
    }
}
